home *** CD-ROM | disk | FTP | other *** search
-
- ~4Dgifts/src/exampleCode/MP/kernel_switch README
-
-
- This directory contains an example that shows how to combine mips1
- and mips2 objects into a single mips1 and mips2 runnable executable
- through a jump table implementation.
-
- The idea of the jump table is to eliminate the necessity for
- maintaining multiple source trees and binaries for different
- SGI instruction set architectures, while most features of the
- distinct instruction sets can still be exploited. Basically, the
- bulk of a code is compiled with the -mips1 flag, but a selected few
- time consuming modules are duplicated and compiled twice with both
- the mips1 and the mips2 flags. Jump table entries of these modules
- are then added to an include file, and the correct version of the
- modules will be selected during run time based on an environment
- variable setting. The magic number of the executable is changed
- to mips1 so that it can run on both mips1 and mips2 systems.
- Please read the small-case lines in main.f and the jump table related
- assembler, C, and include files in this directory to know more about
- the jump table implementation.
-
-
- To test the example:
-
- 1) make clobber
- 2) make
- 3) setenv SGI_ISA mips1 (or mips2)
- 4) ./run < ./input
-
-
- To add a new entry in the jump table:
-
- 1) make two copies of the source routine of the new
- entry, say foo.
- 2) name one copy foo_mips1 and the other foo_mips2.
- 3) add the following line to jmpsyms.h
-
- JMPTAB_ENTRY(foo,_mips1,_mips2)
-
- 4) by default foo returns an integer as defined in jmptab.h.
- change the include file if foo returns floating points.
- no change is necessary if foo returns void.
-
-
- Example: (on a crimson running 4.0.5)
-
- smith 51# setenv SGI_ISA mips1
- smith 52# !./
- ./run < input
- MA,NA,MB,NB,MC,NC,IDUMP = 200 200 200 200
- 200 200 1
-
-
- * CPU TIME FOR OUTER PRODUCT = 1.000000
- WALL TIME FOR OUTER PRODUCT = 0.8900000
- MEGAFLOPS = 17.97753
- smith 53# setenv SGI_ISA mips2
- smith 54# !./
- ./run < input
- MA,NA,MB,NB,MC,NC,IDUMP = 200 200 200 200
- 200 200 1
-
-
- * CPU TIME FOR OUTER PRODUCT = 1.000000
- WALL TIME FOR OUTER PRODUCT = 0.8300000
- MEGAFLOPS = 19.27711
-
-
- This example shows a jump table implementation of a simple matrix
- multiple of double precision real arrays. The matrix multiply
- routine is duplicated and compiled with both -mips1 and -mips2,
- and a jump table entry is added. The test results on a mips2-based
- machine indicate that the program runs ~8 percent better when
- the mips2 kernel is selected. The mips1 kernel would be the only
- choice if the executable is run on a mips1 machine.
-
-
- Disclaimer:
-
- 1) A jump table implementation may result in noticable performance
- degradation due to the jump table overhead and the use of -mips1
- for the majority of the code.
-
- 2) The jump table example works on IRIX 4.0.5 and earilier, or
- any COFF-based SGI environment.
-